/*
package com.campus_information_portal.dao;

import com.campus_information_portal.util.ExemptionTime;
import org.apache.ibatis.jdbc.SQL;

import java.util.Calendar;
import java.util.Date;

*/
/**
 * @author 20155873 张联富
 * @Description $Description$
 * @methodName $methodName$
 * @date $date$ $time$
 * @return $returns$
 *//*

public class ExemptionSqlProvider {
    public String query(int pageIndex,int pageSize,int exemptionFlag) {

            return new SQL() {{
                SELECT("exemption.*");
                SELECT("student.stu_num ,student.stu_name,student.academy_id");
                SELECT("term.term_num,term.term_year");
                SELECT("academy.academy_name");
                FROM("exemption,student,term,academy");
                String timeRange1="";
                String timeRange2="";
                String timeRange3="";
                String timeRange4="";
                Date time = ExemptionTime.getNetworkTime();
                Calendar NowCalendar = Calendar.getInstance();
                NowCalendar.setTime(time);
                //获取当前标准年份
                int NowYear = NowCalendar.get(Calendar.YEAR);
                int month = NowCalendar.get(Calendar.MONTH) + 1;
                if(month>=3&&month<=6){
                    timeRange1=NowYear+"-"+"03-01";
                    timeRange2=NowYear+"-"+"6-30";
                    WHERE("(apply_time>='"+timeRange1+"' and apply_time<='"+timeRange2+"' )");
                }
                if(month>=9){
                    timeRange1=NowYear+"-"+"09-01";
                    timeRange2=NowYear+1+"-"+"2-27";

                    WHERE("(apply_time>='"+timeRange1+"' and apply_time<='"+timeRange2+"' )  ");
                }

                if (dorStuTerm.getStuName() != null) {
                    WHERE("stu_name=#{stuName}");
                }
                if (dorStuTerm.getDormitoryNum() != null) {
                    WHERE("dormitory_num=#{dormitoryNum}");
                }
                if (dorStuTerm.getAcademyName() != null) {
                    WHERE("academy_name=#{academyName}");
                }
                if (dorStuTerm.getStuNum() != null) {
                    WHERE("stu_num=#{stuNum}");
                }
                if (dorStuTerm.getStuSex() != null) {
                    WHERE("stu_sex=#{stuSex}");
                }
                if (dorStuTerm.getApplyState() != null) {
                    WHERE("apply_state=#{applyState}");
                }
                if (dorStuTerm.getTermYear() != null) {
                    WHERE("term_year=#{termYear}");
                }
                if (dorStuTerm.getTermNum() != null) {
                    WHERE("term_num=#{termNum}");
                }
                if (dorStuTerm.getApplyDate() != null) {
                    WHERE("apply_date=#{applyDate}");
                }
            }}.toString();
        }
}
*/
